//
//  NSString+QMUI.m
//  HXBaseProjectDemo
//
//  Created by YaSha_Tom on 2018/2/2.
//  Copyright © 2018年 亚厦装饰股份有限公司. All rights reserved.
//

#import "NSString+QMUI.h"

@implementation NSString (QMUI)

- (BOOL)qmui_includesString:(NSString *)string {
    if (!string || string.length <= 0) {
        return NO;
    }
    
    if ([self respondsToSelector:@selector(containsString:)]) {
        return [self containsString:string];
    }
    
    return [self rangeOfString:string].location != NSNotFound;
}

+ (NSString *)qmui_stringByConcat:(id)firstArgv, ... {
    if (firstArgv) {
        NSMutableString *result = [[NSMutableString alloc] initWithFormat:@"%@", firstArgv];
        
        va_list argumentList;
        va_start(argumentList, firstArgv);
        id argument;
        while ((argument = va_arg(argumentList, id))) {
            [result appendFormat:@"%@", argument];
        }
        va_end(argumentList);
        
        return [result copy];
    }
    return nil;
}

@end
